package com.shop.controller;

import com.shop.entity.item.Item;
import com.shop.entity.item.ItemVo;
import com.shop.service.ItemServiceRest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/item")
public class ItemController {
    @Autowired
    ItemServiceRest itemServiceRest;
    @PostMapping("queryAll")
    public Dto queryAll(@RequestBody Item item){
        return DtoUtil.returnDataSuccess(itemServiceRest.queryAll(item));
    }

    /***
     * 商品展示页
     * @param itemVo
     * @return
     */
    @PostMapping("queryAllshow")
    public Dto queryAllshow(@RequestBody ItemVo itemVo){
        return DtoUtil.returnDataSuccess(itemServiceRest.queryAllshow(itemVo));
    }
}
